/* util */
import http from '@src/util/http'

const prefix = '/api/voice/outside'

/**
 * @description: 获取所有应用列表
 */
export function getAppList(params) {
  return http.get(`${prefix}/intelligent/plan/getAppList`, params)
}

/**
 * @description: 根据应用获取所有模块列表
 */
export function getModuleList(params) {
  return http.get(`${prefix}/intelligent/plan/getTriggerFormByType`, params)
}

/**
 * @description: 获取应用表单字段
 */
export function getTriggerFieldList(params) {
  return http.get(`${prefix}/intelligent/plan/getTriggerFieldList`, params)
}

/**
 * @description: 获取所有应用列表
 */
export function getPageList(params) {
  return http.post(`${prefix}/intelligent/plan/getPageList`, params)
}

/**
 * @description: 新建编辑智能计划
 */
export function createOrUpdate(params) {
  return http.post(`${prefix}/intelligent/plan/createOrUpdate`, params)
}

/**
 * @description: 校验名称是否重复
 */
export function checkPlanName(params) {
  return http.get(`${prefix}/intelligent/plan/checkPlanName`, params)
}


/**
 * @description: 校验计划范围查询的数据是否为空
 */
export function checkPlanRange(params) {
  return http.post(`${prefix}/intelligent/plan/checkPlanRange`, params)
}

/**
 * @description: 校验计划范围匹配数据是否支持联系人设置
 */
export function checkLinkManSetting(planType, params) {
  return http.post(`${prefix}/intelligent/plan/checkLinkManSetting?planType=${planType}`, params)
}

/**
 * @description: 查看计划范围匹配数据
 */
 export function showPlanRange(params) {
  return http.post(`${prefix}/intelligent/plan/showPlanRange`, params)
}

/**
 * @description: 智能计划详情
 */
export function getDetail(params) {
  return http.get(`${prefix}/intelligent/plan/getDetail`, params)
}

/**
 * @description: 修改计划名称
 */
export function updatePlanName(params) {
  return http.get(`${prefix}/intelligent/plan/updatePlanName`, params)
}

/**
 * @description: 智能计划详情动态信息
 */
export function getIntelligentPlanRecord(params) {
  return http.get(`${prefix}/intelligent/plan/getIntelligentPlanRecord`, params)
}

/**
 * @description: 取消智能计划
 */
export function cancelPlan(params) {
  return http.get(`${prefix}/intelligent/plan/cancel`, params)
}

/**
 * @description: 删除智能计划
 */
export function deletePlan(params) {
  return http.get(`${prefix}/intelligent/plan/delete`, params)
}

/**
 * @description: 智能计划详情计划范围
 */
export function getIntelligentPlanRange(params) {
  return http.get(`${prefix}/intelligent/plan/getIntelligentPlanRange`, params)
}

/**
 * @description: 移除智能计划详情计划范围
 */
export function removeIntelligentPlanRange(params) {
  return http.get(`${prefix}/intelligent/plan/removeIntelligentPlanRange`, params)
}

/**
 * @description: 计划范围调整联系人
 */
export function updatePlanRangeLinkMan(params) {
  return http.get(`${prefix}/intelligent/plan/updatePlanRangeLinkMan`, params)
}

/**
 * @description: 统计智能计划运行情况
 */
export function getPlanRunStates(params) {
  return http.get(`${prefix}/intelligent/plan/getPlanRunStates`, params)
}

/**
 * @description: 查询智能计划任务明细
 */
export function getPlanJobDetails(params) {
  return http.get(`${prefix}/intelligent/plan/getPlanJobDetails`, params)
}

/**
 * @description: 智能计划详情任务明细手动触发任务
 */
export function executePlanJob(params) {
  return http.get(`${prefix}/intelligent/plan/executePlanJob`, params)
}

/**
 * @description: 智能计划详情任务明细调整任务执行时间
 */
export function planAdjustTime(params) {
  return http.get(`${prefix}/intelligent/plan/planAdjustTime`, params)
}

/**
 * @description: 智能计划详情任务明细删除任务
 */
export function removePlanJob(params) {
  return http.get(`${prefix}/intelligent/plan/removePlanJob`, params)
}

/**
 * @description: 升级到智能计划
 */
 export function upgradeToSmartPlan(params) {
  return http.get(`${prefix}/intelligent/plan/upgradeToSmartPlan`, params)
}

/**
 * @description: 判断是否有计划任务数据
 */
 export function checkPlanTask(params) {
  return http.get(`${prefix}/intelligent/plan/checkPlanTask`, params)
}
